#include "tcp.h"

int main(int argc, char*argv[]){

	int fd;
	int ret, i = 2;
	char buf[BUFSIZ] = {"====test====\n"};

	/*检查参数*/
	Argment(argc, argv);
	/*创建套接字*/
	fd = SocketInit(argv, false);
	/*发送数据*/
	while(i--){
		do {
			ret = send(fd, buf, strlen(buf), 0);
		}while(ret < 0 && errno == EINTR);
		if(ret < 0)
			ErrExit("recv");
		else if(!ret)
			break;
		printf("send data:%s", buf);
		fflush(stdout);
	}

	close(fd);	
	return 0;
}
